const express = require('express');
const router = express.Router();
const resumeController = require('../controllers/resume.controller');
const { authenticate, authorize } = require('../middleware/auth');

// 企业用户 - 简历筛选相关接口
router.get('/', authenticate, authorize('company'), resumeController.getResumes);
router.get('/:id', authenticate, authorize('company'), resumeController.getResumeById);
router.put('/:id/status', authenticate, authorize('company'), resumeController.updateResumeStatus);
router.post('/send-interview', authenticate, authorize('company'), resumeController.sendInterview);

// 求职者 - 简历管理接口
router.post('/', authenticate, authorize('job_seeker'), resumeController.upsertResume);
router.get('/my-resume', authenticate, authorize('job_seeker'), resumeController.getMyResume);
router.delete('/:id', authenticate, authorize('job_seeker'), resumeController.deleteResume);

module.exports = router;